<?php
session_start();
include("connect.php");
$mc_QRadiobtn='';
if(isset($_GET['mc_QRadiobtn0']) && $_GET['mc_QRadiobtn0']!='')
{
	$mc_QRadiobtn=$_GET['mc_QRadiobtn0'];
}
elseif(isset($_GET['mc_QRadiobtn1']) && $_GET['mc_QRadiobtn1']!='')
{
	$mc_QRadiobtn=$_GET['mc_QRadiobtn1'];
}
elseif(isset($_GET['mc_QRadiobtn2']) && $_GET['mc_QRadiobtn2']!='')
{
	$mc_QRadiobtn=$_GET['mc_QRadiobtn2'];
}
elseif(isset($_GET['mc_QRadiobtn3']) && $_GET['mc_QRadiobtn3']!='')
{
	$mc_QRadiobtn=$_GET['mc_QRadiobtn3'];
}
elseif(isset($_GET['mc_QRadiobtn4']) && $_GET['mc_QRadiobtn4']!='')
{
	$mc_QRadiobtn=$_GET['mc_QRadiobtn4'];
}
$mc_QRadiobtn=$_POST['iQGame'];
$txtfeedback=$_POST['strFeedback'];
$email=$_SESSION['email_id'];
$fname=$_SESSION[ques_group];

$query="insert into feedback(email,feedback,game_quality,file_name) values('$email','$txtfeedback','$mc_QRadiobtn','$fname')";
mysql_query($query);

require("../includes/class.phpmailer.php");
$mail = new PHPMailer();
//$mail->Host     = "smtp.emailsrvr.com";
//$mail->Mailer   = "smtp";
//$mail->Port = "587";
//$mail->SMTPDebug = "false";
//$mail->SMTPAuth = "true";
//$mail->SMTPKeepAlive = "true";
//$mail->Username = "a.namdeo@whizlabs.com";
//$mail->Password = "namdeo@4";
$mail->IsHTML(True);


//#######################################################################//
//################### Mail to Support ###################################//
//#######################################################################//
$support_email_to="info@omcareers.org";
$support_email_from="info@omcareers.org";
$support_email_subject="FeedBack";
$to="$support_email_to";
$mail->From     = $support_email_from;
$mail->FromName = "OM Careers";
$mail->Subject	= "$support_email_subject";
$mail->Body = $txtfeedback;
$mail->AddAddress($to, 'OM Careers');
#echo "1";
if(!$mail->Send())
     echo "There has been a mail error sending to 2" ;

// Clear all addresses and attachments for next loop.
$mail->ClearAddresses();
//######################################
header("location:../thank-you.html?msg=feedback");
?>